#include "MainMenu.h"
#include "Application.h"

MainMenu::MainMenu(Application* app) : Menu(app)
{
    setBackgroundImage("main_menu.png");

    play = new WidgetButton(this, 300,250,200,50,"Play",25);
    editor = new WidgetButton(this, 300,310,200,50,"Map Editor",25);
    quit = new WidgetButton(this, 300,450,200,50,"Quit",25);

    addWidget(play);
    addWidget(editor);
    addWidget(quit);
}

void MainMenu::onButtonPressed(WidgetButton* button)
{
    if(button == play)
        app->setActiveMode(Application::GAME);

    if(button == editor)
        app->setActiveMode(Application::EDITOR);

    if(button == quit)
        app->quit();
}

MainMenu::~MainMenu()
{
    //dtor
}
